package com.xywy.beautyand.ADAPTER;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.xywy.beautyand.R;
import com.xywy.beautyand.base.BasicAdapter;
import com.xywy.beautyand.bean.MyCollectionItem;

public class MyCollectAdapter extends BasicAdapter<MyCollectionItem> {
  private LayoutInflater inflater;
	 
	
	public MyCollectAdapter(Context context, List<MyCollectionItem> list) {
		super(context, list);
		this.inflater=LayoutInflater.from(context);
	}
   
	@SuppressWarnings("unchecked")
	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		  viewholder holder=null;
		if(convertView==null){
			convertView= inflater.inflate(R.layout.item_my_collection,null);
		    holder=new viewholder();
		    holder.title=(TextView) convertView.findViewById(R.id.my_collection_title);
		    convertView.setTag(holder);
		}else{
			holder = (viewholder) convertView.getTag();	
		 }
		holder.title.setText(list.get(position).getTitle());
		
		return convertView;
		}
	
	private class viewholder{
		TextView title;
		
	}
}
